home *** CD-ROM | disk | FTP | other *** search
- ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- ` 2D Parallax Starfield
- ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- ` By Rich Davey (rich@fatal-design.com)
- ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- ` Music listened to while coding this
- ` Madonna (Ray of Light)
- ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- ` Note:
- `
- ` On my graphics card (GeForce 256 Pro) I can get a consistent 75 fps
- ` with 500 stars on-screen. You can push this up to around 800 stars
- ` if you change the x array into 3 seperate arrays, instead of having
- ` 1 array with 3 elements.
-
- sync rate 0
- sync on
- hide mouse
-
- n=500
- dim x(n,3)
-
- for i=1 to n
- x(i,1)=rnd(639)+1
- x(i,2)=rnd(479)+ 1
- x(i,3)=rnd(9)+1
- next i
-
- do
- cls 0
-
- for i=1 to n
-
- x(i,1)=x(i,1)-x(i,3)
-
- if x(i,1)<=1
- x(i,1)=640
- x(i,2)=rnd(479)+1
- endif
-
- col=x(i,3)*30
- ink rgb(col,col,col),1
-
- dot x(i,1),x(i,2)
-
- next i
-
- sync
-
- loop
-
-